<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pm="http://primefaces.org/mobile"
	xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
	xmlns:b="http://bootsfaces.net/ui"
	template="/templates/layout_mb.xhtml">

	<ui:define name="pcontent">
	<b:well>
		<h:form id="frm1">
		<p:growl id="msgs" showDetail="true" /> 		
			<h:outputText value="合同名称："/> 
            <p:inputText value="#{mobileRptInfoMB.selectedContract.name}" disabled="true" style="margin-bottom:10px"/><br />
            <h:outputText value="产品ID："/> 
            <p:selectOneMenu value="#{mobileRptInfoMB.selectedContProd}"  converter="bmeContProdConverter"
						effect="fade"  style="width:60%;margin-bottom:10px;" panelStyle="width:220px"
                        var="t" filter="true" filterMatchMode="startsWith"
                        required="true" requiredMessage="产品名称必须输入">   
                     
                     <p:ajax update="proddesc prodnum prodprice prodamount produnit prodarea" listener="#{mobileRptInfoMB.initRptInfo}"/>
		            <f:selectItems value="#{mobileRptInfoMB.bmeContProds}" var="item" itemLabel="#{item.bmeMaterial.id}" itemValue="#{item}" />
		 
		            <p:column headerText="编号">
		                <h:outputText value="#{t.bmeMaterial.id}" />
		            </p:column>		 
		            <p:column headerText="描述">
		                <h:outputText value="#{t.bmeMaterial.mdesc}" />
		            </p:column>     
		            <p:column headerText="数量">
	               <h:outputText value="#{t.quantity}" />
	           		</p:column>
	           <p:column headerText="单价">
	               <h:outputText value="#{t.price}" />
	           </p:column>
	            <p:column headerText="金额">
	               <h:outputText value="#{t.amount}" />
	           </p:column>   
		        </p:selectOneMenu><br />
		        <h:outputText value="描述："/> 
            <p:inputText id="proddesc" value="#{mobileRptInfoMB.bmeMaterial.mdesc}" style="margin-bottom:10px"/><br />
		    <h:outputText value="数量："/> 
            <p:inputText id="prodnum" value="#{mobileRptInfoMB.selectedContProd.quantity}" style="margin-bottom:10px"/><br />
            <h:outputText value="单价："/> 
            <p:inputText id="prodprice" value="#{mobileRptInfoMB.selectedContProd.price}" style="margin-bottom:10px"/><br />
            <h:outputText value="金额："/> 
            <p:inputText id="prodamount"  value="#{mobileRptInfoMB.selectedContProd.amount}" style="margin-bottom:10px"/><br />
            <h:outputText value="单位："/> 
            <p:inputText id="produnit" value="#{mobileRptInfoMB.bmeMaterial.munit}" style="margin-bottom:10px"/><br />
            <h:outputText value="安装区域："/> 
            <p:inputText id="prodarea" value="#{mobileRptInfoMB.selectedContProd.area}" style="margin-bottom:10px"/><br />
            <h:outputText value="安装费用："/> 
            <p:inputText value="#{mobileRptInfoMB.bmeRptInfo.mamount}"  style="margin-bottom:10px;" converterMessage="金额必须是数字类型"/><br />
            
            <h:outputText value="日期："/>
				<p:calendar id="signDate" locale="zh" navigator="true"  value="#{mobileRptInfoMB.bmeRptInfo.endDate}" 
					pattern="yyyy-MM-dd" mask="true"  mode="popup"	showOn="button" popupIconOnly="true"
					required="true" requiredMessage="日期必须输入" /><br />
              	
		<h:panelGrid columns="2" cellspacing="30" styleClass="btnCenter" style="margin-top:10px">
			<p:commandButton id="btnQuery" value="提交" icon="ui-icon-check"							
				action="#{mobileRptInfoMB.saveRptInfo}" update="@form"
				style="font-size:16px;color:white;background-color:#3366AA;">
			</p:commandButton>
			<p:button outcome="home_mb.xhtml" value="主页" icon="ui-icon-home"  style="font-size:16px;color:white;background-color:#3366AA;"/>
		</h:panelGrid>
		</h:form>
		</b:well>
	</ui:define>

</ui:composition>